package buco.integrity.assertion;

import org.json.simple.JSONObject;

import buco.core.api.SemanticConstraint;
import buco.core.api.Version;

public class AssertPackageConnected extends SemanticConstraint {

	private String packageName;
	private Version version;
	
	@Override
	protected void deserialize(JSONObject jsonObject) throws Exception {
		packageName = jsonObject.get("packageName").toString();
		if(jsonObject.get("version") != null) {
			version = Version.fromString(jsonObject.get("version").toString());
		}
	}

	public String getPackageName() {
		return packageName;
	}

	public Version getVersion() {
		return version;
	}
}
